﻿<Page
    x:Class="SgfEdwin8.WindowSwitchingDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SgfEdwin8"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="#C7419082" 
    KeyDown="WindowSwitchingKeyDown">

    <!-- this is design time only -->
    <Page.Resources>
        <local:SampleStringList x:Key="sampleData1"/>
    </Page.Resources>

    <Grid Background="#C7419082" x:Name="windowSwitchingDlgGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <!-- Need inner grid so that outer grid overlays app, disabling it, while inner grid
             gets big margins to have dialog appear reasonably sized. -->
        <Grid Grid.Row="1" Grid.Column="1">
            <!-- Background="{StaticResource ApplicationPageBackgroundThemeBrush}"-->
            <!--<Grid.Resources>
                <Style TargetType="Grid">
                    <Setter Property="Margin" Value="10" />
                </Style>
                <Style TargetType="TextBlock">
                    <Setter Property="Margin" Value="0,3,5,5" />
                </Style>
                <Style TargetType="StackPanel">
                    <Setter Property="HorizontalAlignment" Value="Right" />
                </Style>
                <Style TargetType="Button" >
                    <Setter Property="Width" Value="70" />
                    <Setter Property="Height" Value="25" />
                    <Setter Property="Margin" Value="5,0,0,0" />
                </Style>
            </Grid.Resources>-->

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="400" />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <!-- White -->
            <TextBlock FontSize="16" FontWeight="Bold" Grid.Column="0" 
                       Grid.Row="0" Margin="0,3,5,10">Open Games</TextBlock>
            <ListView Name="gamesList" BorderThickness="1" Grid.Row="1" Width="500"
                     ScrollViewer.VerticalScrollBarVisibility="Visible" 
                      ScrollViewer.VerticalScrollMode="Enabled"
                     BorderBrush="Black" HorizontalAlignment="Stretch" 
                      Background="White"
                     d:DataContext="{StaticResource sampleData1}"
                     ItemsSource="{Binding}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontSize="16" Foreground="Black" Margin="2,5,0,0"/>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>


            <!-- OK or Cancel -->
            <StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
                <!-- Margin is left, top, right, bottom -->
                <Button Name="switchButton" Click="selectButton_click" FontSize="14" Foreground="Black" 
                        Padding="0" Height="40" Width="120" Margin="2,0,2,0"
                        Background="LightGray">Switch to Game</Button>
                <Button Name="deleteButton" Click="deleteButton_click" FontSize="14" Foreground="Black" 
                        Padding="0" Height="40" Width="120" Margin="2,0,2,0"
                        Background="LightGray">Close Game</Button>
                <Button Name="cancelButton" Click="cancelButton_click" FontSize="14" Foreground="Black" 
                        Padding="0" Height="40" Width="120" Margin="2,0,2,0"
                        Background="LightGray">Cancel</Button>
            </StackPanel>

        </Grid>

    </Grid>
</Page>